import { Meta, StoryFn } from '@storybook/vue3'
import Iconfont from '@/libs/Iconfont/index.vue'

export default {
  title: '通用/Iconfont',
  component: Iconfont,
  parameters: {
    docs: {
      description: {
        component:
          '集成iconfont、ant-design-icon、element-icon、（src/assets/icons目录下的webp图片icon）的统一图标调用组件',
      },
      source: {
        language: 'html',
        code: `
<icon-font type="i-home" />

<script lang="ts" setup>
  import Iconfont from '@/libs/Iconfont/index.vue'
</script>
`,
      },
    },
  },
} as Meta<typeof Iconfont>

export const Default: StoryFn = args => ({
  components: { Iconfont },
  setup() {
    return { args }
  },
  template: `
    <div :style="{fontSize: args.styleFontSize+'px', color: args.styleColor}">
    <Iconfont v-bind="args" />
    </div>
  `,
})
Default.args = {
  type: 'p-home',
  styleColor: '#f00',
  styleFontSize: 50,
}
Default.storyName = '默认'
